From 2393a70a1ceb7b28eeb510a53ef9cd976e796c45 Mon Sep 17 00:00:00 2001 From: justbur Date: Tue, 7 Jul 2015 11:08:11 -0400 Subject: [PATCH] Add small indication of more pages --- which-key.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/which-key.el b/which-key.el index 8ae01e55079..d2b06cfb0f4 100644 --- a/which-key.el +++ b/which-key.el @@ -387,7 +387,7 @@ the maximum number of lines availabel in the target buffer." (max-keys/page (when max-height (* n-columns max-height))) (n-pages (if max-keys/page (ceiling (/ (float n-keys) max-keys/page)) 1)) - pages act-height) + pages act-height first-page) (when (and (> n-keys 0) (> n-columns 0)) (dotimes (p n-pages) (setq pages @@ -397,11 +397,13 @@ the maximum number of lines availabel in the target buffer." ;; not doing anything with other pages for now (setq pages (reverse pages) act-height (1+ (s-count-matches "\n" (car pages)))) + (setq first-page (car pages)) + (when (> (length pages) 1) (setq first-page (concat first-page "..."))) (if (eq which-key-popup-type 'minibuffer) - (let (message-log-max) (message "%s" (car pages))) + (let (message-log-max) (message "%s" first-page)) (with-current-buffer which-key--buffer (erase-buffer) - (insert (car pages)) + (insert first-page) (goto-char (point-min))))) (cons act-height act-width))) -- 2.30.2